<template>
  <div>asdasd</div>
</template>
<script>
import{vueResource} from 'vue-resource'
export default {
  name: "index",
  data() {
    return {};
  },
  created() {
      this.test();
  },
  methods: {
      test(){
          this.$http.get('static/map/plays.json').then(res=>{

              console.log(res.body);
          });

      },
   amountFor(aPerformance,play){
      let thisAmout = 0;
       switch (play.type) {
          case "tragedy":
            thisAmout = 40000;
            if (aPerformance.audience > 30) {
              thisAmout += 1000 * (aPerformance.audience - 30);
            }
            break;
          case "comedy":
            thisAmout = 30000;
            if (aPerformance.audience > 20) {
              thisAmout += 1000 + 500 * (aPerformance.audience - 20);
            }
            thisAmout += 300 * aPerformance.audience;
            break;
          default:
            throw new Error(`unknown type:${play.type}`);
            break;
        }
        return thisAmout;

    },
  }
};
</script>